const TokenKey = 'Moblie-Token'

export function getToken () {
  try {
    const token = JSON.parse(localStorage.getItem(TokenKey))
    return token
  } catch (err) {
    console.log(err, '获取token失败')
    return null
  }
}

export function setToken (token) {
  try {
    localStorage.setItem(TokenKey, JSON.stringify(token))
    return
  } catch (err) {
    console.log(err, '存储token失败')
    return null
  }
}

export function removeToken () {
  return localStorage.removeItem(TokenKey)
}
